<?php if ($command == "redirect"): ?>
	<div id="success-notice-2">
		Welcome, Batanayi, you've successfully signed in to DocPlus! Please wait a moment while this page is being refreshed on your behalf.
	</div>
	<script type="text/javascript">
		//[CDATA[
		$(document).ready(function(){
			// reload the current parent window
			reloadWindow();
		});
		//]]
	</script>
<?php else: ?>
	<form id="sign-in-form" action="<?php echo url_for('/profile-sign-in-mini') ?>" method="post">
		<?php echo $form->renderHiddenFields(false) ?>
		<div id="sign-in-row">
			<div id="sign-in-heading">Sign In</div>
		</div>
		<div class="row">
			<ul class="text">
				<li class="first">
					<?php echo $form['email']->renderLabel() ?>
					<?php echo $form['email'] ?>
					<?php if ($form["email"]->hasError()): ?>
						<?php include_partial("common/error", array("form" => $form, "field" => "email", "name_format" => "sign_in")) ?>
					<?php endif; ?>
				<li>
					<?php echo $form['password']->renderLabel() ?>
					<?php echo $form['password'] ?>
					<?php if ($form["password"]->hasError()): ?>
						<?php include_partial("common/error", array("form" => $form, "field" => "password", "name_format" => "sign_in")) ?>
					<?php endif; ?>
				</li>
			</ul>
		</div>
		<div class="clear"></div>
		<div class="sign-in-row">
			<ul class="submit">
				<li>
					<button class="blue-button-30" type="submit" id="submit-sign-in-mini">Sign In</button>
				</li>
				<li>
					<div>I forgot my <a id="forgot-password-link" href="javascript:;">password</a></div>
				</li>
			</ul>
		</div>
	</form>
	<script type="text/javascript">
		//<![CDATA[
		$(document).ready(function(){
			// hide element's error on focus
			$formElement = $('form .prompt-text');
			$formElement.live("focus", function() {
				$this = $(this);
				$("#" + $this.attr("id") + "_error").addClass("error-invisible").removeClass("error-visible");
			});

			// don't show the labels for non-empty input elements
			$('form .prompt-text').each(function(){
				$this = $(this);
				$thisLabel = $this.parent().find(":eq(0)");

				if($.trim($this.val())) {
					$thisLabel.addClass("label-invisible");
					$this.addClass('user-text');
				}
			});

			// make an attempt to submit this form
			$('#submit-sign-in-mini').click(function() {
				$('#sign-in-form').ajaxSubmit(function(data){
					$('#sign-in-block').html(data);
				});
				return false;
			});

			$('#forgot-password-link-mini').click(function() {
				$('#sign-in-block').hide();
				$('#reset-password-block').show();
				return false;
			});
		});
		//]]>
	</script>
<?php endif; ?>